package modellayer;

import java.util.ArrayList;

/**
 * The customer class to create customer objects
 * @author Allan Eriksen, Andreas Rye, Casper Madsen, Christian Stidsborg, Stefan Bols
 */

public class Product {
	private int productNo;
	private String barcode;
	private String name;
	private String description;
	private double purchagePrice; 
	private double salesPrice; 
	private double rentPricePrDay;
	private String countryOfOrigin;
	private int stock; 
	private int minStock; 
	private Supplier supplierObj;
	private ArrayList<Product> products;
	private boolean isDummy;
	/**
	 * Produt fields
	 * @param productNo
	 * @param barcode
	 * @param name
	 * @param description
	 * @param purchagePrice
	 * @param salesPrice
	 * @param rentPricePrDay
	 * @param countryOfOrigin
	 * @param stock
	 * @param minStock
	 * @param products
	 * @param supplierObj
	 */
	
	/**
	 * Constructor for the Product class
	 * @param productNo
	 * @param barcode
	 * @param name
	 * @param description
	 * @param purchagePrice
	 * @param salesPrice
	 * @param rentPricePrDay
	 * @param countryOfOrigin
	 * @param stock
	 * @param minStock
	 * @param products
	 * @param supplierObj
	 */
	public Product(int productNo, String barcode, String name,
			String description, double purchagePrice, double salesPrice,
			double rentPricePrDay, String countryOfOrigin, int stock,
			int minStock, ArrayList<Product> products, Supplier supplierObj) {
		super();
		this.productNo = productNo;
		this.barcode = barcode;
		this.name = name;
		this.description = description;
		this.purchagePrice = purchagePrice;
		this.salesPrice = salesPrice;
		this.rentPricePrDay = rentPricePrDay;
		this.countryOfOrigin = countryOfOrigin;
		this.stock = stock;
		this.minStock = minStock;
		this.supplierObj = supplierObj;
		this.isDummy = false;
	}
	
	/**
	 * 
	 * @param productNo
	 */
	public Product(int productNo) {
		this.productNo = productNo;
		this.isDummy = true;
	}
	
	/**
	 * Get method for the product number
	 * @return the productNo
	 */
	public int getProductNo() {
		return productNo;
	}
	/**
	 * Set method for the product number
	 * @param productNo 
	 */
	public void setProductNo(int productNo) {
		this.productNo = productNo;
	}
	/**
	 * Get method for the barcode
	 * @return the barcode
	 */
	public String getBarcode() {
		return barcode;
	}
	/**
	 * Set method for the barcode
	 * @param barcode 
	 */
	public void setBarcode(String barcode) {
		this.barcode = barcode;
	}
	/**
	 * Get method for the name
	 * @return the name
	 */
	public String getName() {
		return name;
	}
	/**
	 * Set method for the name
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}
	/**
	 * Get method for the description
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	/**
	 * Set method for the description
	 * @param description 
	 */
	public void setDescription(String description) {
		this.description = description;
	}
	/**
	 * Get method for the purchase price
	 * @return the purchagePrice
	 */
	public double getPurchagePrice() {
		return purchagePrice;
	}
	/**
	 * Set method for the purchase price
	 * @param purchagePrice
	 */
	public void setPurchagePrice(double purchagePrice) {
		this.purchagePrice = purchagePrice;
	}
	/**
	 * Get method for the sales price
	 * @return the salesPrice
	 */
	public double getSalesPrice() {
		return salesPrice;
	}
	/**
	 * Set method for the sales price
	 * @param salesPrice 
	 */
	public void setSalesPrice(double salesPrice) {
		this.salesPrice = salesPrice;
	}
	/**
	 * Get method for the rent price per day
	 * @return the rentPricePrDay
	 */
	public double getRentPricePrDay() {
		return rentPricePrDay;
	}
	/**
	 * Set method for the rent price per day
	 * @param rentPricePrDay
	 */
	public void setRentPricePrDay(double rentPricePrDay) {
		this.rentPricePrDay = rentPricePrDay;
	}
	/**
	 * Get method for the country of origin
	 * @return the countryOfOrigin
	 */
	public String getCountryOfOrigin() {
		return countryOfOrigin;
	}
	/**
	 * Set method for the country of origin
	 * @param countryOfOrigin
	 */
	public void setCountryOfOrigin(String countryOfOrigin) {
		this.countryOfOrigin = countryOfOrigin;
	}
	/**
	 * Get method for the stock
	 * @return the stock
	 */
	public int getStock() {
		return stock;
	}
	/**
	 * Set method for the stock
	 * @param stock
	 */
	public void setStock(int stock) {
		this.stock = stock;
	}
	/**
	 * Get method for the minimum stock
	 * @return the minStock
	 */
	public int getMinStock() {
		return minStock;
	}
	/**
	 * Set method for the minimum stock
	 * @param minStock
	 */
	public void setMinStock(int minStock) {
		this.minStock = minStock;
	}
	
	/**
	 * This method returns boolean true if the product is a group of products.
	 * @return returnVal
	 */
	public boolean isProductGroup() {
		boolean returnVal = false;
		if (products!=null) {
			returnVal = true;
		}
		
		return returnVal;
	}
	
	/**
	 * Get method for the suppplier obj
	 * @return the supplierObj
	 */
	public Supplier getSupplierObj() {
		return supplierObj;
	}
	/**
	 * Set method for the supplier object
	 * @param supplierObj 
	 */
	public void setSupplierObj(Supplier supplierObj) {
		this.supplierObj = supplierObj;
	} 

	
	/**
	 * @return the isDummy
	 */
	public boolean isDummy() {
		return this.isDummy;
	}
	
}
